﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Oplaco.Web.DTO
{
    /// <summary>
    /// Generic interface for all the cachable data objects
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ICacheableDataTransferObject<T>
    {
        /// <summary>
        /// Database identifier
        /// </summary>
        int Id { get; set; }

        /// <summary>
        /// Position in the collection
        /// </summary>
        int Rank { get; set; }

        /// <summary>
        /// Id of the user
        /// </summary>
        int MemberId { get; set; }
        
        /// <summary>
        /// Title 
        /// </summary>
        String Title { get; set; }

        /// <summary>
        /// Link
        /// </summary>
        String Url { get; set; }

        /// <summary>
        /// Checks if the given object matches this
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        bool Equals(object obj);

        /// <summary>
        /// Checks if there is a child collection
        /// </summary>
        bool HasChilds { get;  }

        /// <summary>
        /// Current published datetime
        /// </summary>
        DateTime PublishDate { get; set; }

        /// <summary>
        /// Based on the same inteface a collection of childs
        /// </summary>
        ICollection<T> ChildCollection { get;  }

    }
}
